import type { App } from "vue";
// 引入自定义图标
import close from "@/assets/svg/close.svg";
import closeAll from "@/assets/svg/close-all.svg";
import closeLeft from "@/assets/svg/close-left.svg";
import closeOther from "@/assets/svg/close-other.svg";
import closeRight from "@/assets/svg/close-right.svg";
import exitScreen from "@/assets/svg/exit-screen.svg";
import fullScreen from "@/assets/svg/full-screen.svg";
import globalization from "@/assets/svg/globalization.svg";
import refresh from "@/assets/svg/refresh.svg";
import translate from "@/assets/svg/translate.svg";
// 声明图标组件名
export const iconComponents = [
  close,
  closeAll,
  closeLeft,
  closeOther,
  closeRight,
  exitScreen,
  fullScreen,
  globalization,
  refresh,
  translate
];
const iconName = [
  "close",
  "closeAll",
  "closeLeft",
  "closeOther",
  "closeRight",
  "exitScreen",
  "fullScreen",
  "globalization",
  "refresh",
  "translate",
]

export function useCustomSvgIcon(app: App) {
  // 注册图标
  iconComponents.forEach((component: any,index) => {
    app.component(iconName[index], component);
  });
}